<#include "/common/common.ftl" encoding="UTF-8">
	<link href="${staticUrl}/css/form.css" type="text/css" rel="stylesheet" />
	<link href="${staticUrl}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
	<script src="${staticUrl}/js/validate/jquery.validate.js" type="text/javascript"></script>
	<script src="${staticUrl}/js/validate/messages_cn.js" type="text/javascript"></script>
	<#assign action="article">
	<script>
		var treeUrl = "${request.contextPath}/security/channel!getTreeXml.action?rootId=1";
		$(document).ready(function(){
			//为inputForm注册validate函数
			$("#inputForm").validate();
			$("#channelName").click(function(e){
				previewShow(e);
			});
		});
		function showDetail(id,title){
			$("#channelId").val(id);
			$("#channelName").val(title);
			$("#preview").hide();
		}
	</script>
	<style type="text/css">
	<!--
	.articleTitle {
		font-size: 12px;
		width: 90%;
	}
	-->
	</style>	
</head>
<body style="padding-left: 10px ;" scroll="auto">
<#include "/common/tree_div.ftl" encoding="UTF-8">
<div class="title"><#if id?exists>修改<#else>创建</#if>文章</div>
<div class="content">
<form id="inputForm" action="${action}!save.action" method="post">
<input type="hidden" name="id" value="${(id)?if_exists}" />
<table class="content" scroll="auto">
	<tr>
		<@ftlMacro.inputText name="title" descript="标题" textShow="${title?if_exists}" cssStyle="required articleTitle"/>
	</tr>
	<tr>
		<@ftlMacro.inputText name="shortTitle" descript="副标题" textShow="${shortTitle?if_exists}" cssStyle="articleTitle"/>
	</tr>
	<tr>
		<@ftlMacro.inputText name="author" descript="作者" textShow="${author?if_exists}" />
	</tr>
	<tr>
		<td class="textLabel">所属栏目:</td>
		<td>
			<input type="hidden" name='channel.id' id="channelId" value="${(channel.id)?if_exists}"/>
			<input type="text" class='divshow' name="channel.name" id="channelName" size="40" value="${(channel.name)?if_exists}" class="required"/>		
		</td>
	</tr>
	<tr>
		<td class="textLabel">置顶时间:</td>
		<td>
		<@ftlMacro.dateText name="topTime" value="${topTime?if_exists}"/>
		<#assign isTops = {"1":"置顶","0":"不置顶"} />
		<@ftlMacro.radio name="isTop" textValues=isTops checkedValue=isTop?if_exists />
		</td>
	</tr>
	<#if channel?exists && channel.pertainTemplate?exists && channel.pertainTemplate.path?exists>
	<#include channel.pertainTemplate.path encoding="UTF-8">
	</#if>
	<tr>
		<@ftlMacro.controlFck name="content" textShow="${content?if_exists}" colspan="2"/>
	</tr>
	<tr>
		<@ftlMacro.inputText name="imgUrl" descript="首页图片" textShow="${imgUrl?if_exists}" />
	</tr>
	<tr>
		<@ftlMacro.inputText name="keywords" descript="关键字" textShow="${keywords?if_exists}" cssStyle="required"/>
	</tr>
	<tr>
        <td class="textLabel"><div class='descript' >描述：</div>
        </td>
        <td class="textShow">
           <textarea name="description" class="textareaShow">${(description)?if_exists}</textarea>
        </td>
	</tr>
	<#if createUser?exists>
	<tr>
		<@ftlMacro.detailText descript="创建人" textShow="${createUser.name?if_exists}"/>
	</tr>
	</#if>
	<#if modifyUser?exists>
	<tr>
		<@ftlMacro.detailText descript="修改人" textShow="${modifyUser.name?if_exists}"/>
	</tr>
	</#if>
	<#if createTime?exists>
	<tr>
		<@ftlMacro.detailText descript="创建时间" textShow="${createTime?if_exists}"/>
	</tr>
	</#if>
	<#if modifyTime?exists>
	<tr>
		<@ftlMacro.detailText descript="修改时间" textShow="${modifyTime?if_exists}"/>
	</tr>
	</#if>
	<tr class="button">
		<td colspan="2">
			<input type="submit" value="提交" />&nbsp; 
			<input type="button" value="取消" onclick="history.back()"/>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		</td>
	</tr>
</table>
</div>
</form>
</body>
</html>